//SPDX-FileCopyrightText: Copyright 2025-2025 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package core

import (
	"context"

	"atomgit.com/openlinksaas-org/proto-gen-go.git/project_triger_api"
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
)

type TrigerConfigInfo struct {
	TrigerId  string
	ProjectId string
	Secret    string
}

type TrigerMsgHandler func(ctx context.Context, projectId string, msgInfo *project_triger_api.TrigerMsgInfo, logger *zap.Logger) error

type QueryTrigerInfoHandler func(ctx context.Context, trigerTypeId, trigerId string) (*TrigerConfigInfo, bool)

type TrigerRunner interface {
	Init(group *gin.RouterGroup, queryHandler QueryTrigerInfoHandler, msgHandler TrigerMsgHandler, logger *zap.Logger)
	GetTypeInfo() *project_triger_api.TrigerTypeInfo
}
